annex+http urls and git-annex p2phttp.
* enableremote: Allow type= to be provided when it does not change the
type of the special remote.
+ * importfeed: Fix encoding issues parsing feeds when built with OsPath.
-- Joey Hess <id@joeyh.name> Thu, 25 Sep 2025 13:36:21 -0400
- All functions have been modified to set the close-on-exec
- flag to True.
-
- - Also, functions that return a Handle have been modified to
- - use the locale encoding, working around this bug:
- - https://github.com/haskell/file-io/issues/45
+ - Also, functions that return a Handle (for a non-binary file)
+ - have been modified to use the locale encoding, working around
+ - this bug: https://github.com/haskell/file-io/issues/45
-
- Copyright 2025 Joey Hess <id@joeyh.name>
- Copyright 2024 Julian Ospald
withBinaryFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
withBinaryFile osfp iomode act = (augmentError "withBinaryFile" osfp
- $ withOpenFileEncoding osfp iomode True False closeOnExec (try . act) True)
+ $ withOpenFile' osfp iomode True False closeOnExec (try . act) True)
>>= either ioError pure
openBinaryFile :: OsPath -> IOMode -> IO Handle
openBinaryFile osfp iomode = augmentError "openBinaryFile" osfp $
- withOpenFileEncoding osfp iomode True False closeOnExec pure False
+ withOpenFile' osfp iomode True False closeOnExec pure False
readFile :: OsPath -> IO BSL.ByteString
readFile fp = withFileNoEncoding' fp ReadMode BSL.hGetContents
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 6"""
+ date="2025-09-29T14:45:50Z"
+ content="""
+Thanks for some really good detective work @ewen.
+
+Note that this only happens when git-annex is built with the OsPath build
+flag.
+
+That seems to indicate that the problem is in
+Utility.FileIO.openBinaryFile,
+which is the only way that parseFeedFromFile' varies depending on that
+build flag.
+
+Aha yes, the problem is that uses withOpenFileEncoding, which is
+inappropriate for a binary file!
+"""]]